package com.bohua.intermediary.security;

import com.bohua.intermediary.entity.SysUser;
import com.bohua.intermediary.service.SysUserService;
import lombok.Data;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.Collection;

/**
 * 封装security的User
 */


public class MyUser extends User {

    /*@Resource
    private SysUserService sysUserService;*/
    /**
     * 用户信息
     */
    private SysUser meUser;

    public SysUser getMeUser() {
        return meUser;
    }

    public void setMeUser(SysUser meUser) {
        this.meUser = meUser;
    }

    public MyUser(String username, String password, Collection<? extends GrantedAuthority> authorities) {
        super(username, password, authorities);
    }

    public MyUser(String username, String password, boolean enabled, boolean accountNonExpired, boolean credentialsNonExpired, boolean accountNonLocked, Collection<? extends GrantedAuthority> authorities) {
        super(username, password, enabled, accountNonExpired, credentialsNonExpired, accountNonLocked, authorities);
    }
}
